#
dict1 = {"name":"tom","age":18,}

dict1["name"] = "中国"
print(dict1)

print(dict1.get("name"))
print(dict1.get("id"))

#删除元素
del dict1["country"]
print(dict1)
# del dict1
# print(dict1)

#clear
dict1.clear()
print(dict1)

for key in dict1.keys():
    print(key)

for value in dict1.values():
    print(value)

for k,v in dict1.items():
    print(f"key是{k},value是{v}")

for a in dict1:
    print(a)